home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 169_01 / cls.c < prev    next >
Text File  |  1983-12-15  |  2KB  |  67 lines

  1. /**************************************************************/
  2. /*                                  */
  3. /*  NAME                              */
  4. /*                                  */
  5. /*     cls  - clear video screen                  */
  6. /*                                  */
  7. /*  SYNOPSIS                              */
  8. /*                                  */
  9. /*     cls();                           */
  10. /*                                  */
  11. /*  DESCRIPTION                           */
  12. /*                                  */
  13. /*     This function clears the terminal.  It requires      */
  14. /*     no parameters.  "cls" uses the "csysint" C-to-       */
  15. /*     assembler interface.                      */
  16. /*                                  */
  17. /*  RETURNS                              */
  18. /*                                  */
  19. /*     No return codes are provided.                  */
  20. /*                                  */
  21. /**************************************************************/
  22. cls()
  23. {
  24.      struct regset {
  25.       char al;
  26.       char ah;
  27.       char bl;
  28.       char bh;
  29.       char cl;
  30.       char ch;
  31.       char dl;
  32.       char dh;
  33.      };
  34.      unsigned csysint();
  35.      struct regset sreg;     /* regs to send to csysint */
  36.      struct regset rreg;     /* regs returned from csysint */
  37.      unsigned flags;         /* machine status register */
  38.      int interrupt;         /* interrupt code requested */
  39.  
  40.      interrupt = 0x10;
  41.      sreg.ah = 0;
  42.      sreg.al = 0x03;
  43.  
  44.      sreg.bh = 0;
  45.      sreg.bl = 0;
  46.      sreg.ch = 0;
  47.      sreg.cl = 0;
  48.      sreg.dh = 0;
  49.      sreg.dl = 0;
  50.  
  51.      flags = csysint(interrupt,&sreg,&rreg);
  52. }
  53. /*   ---- test program for above routine commented out..
  54. main()
  55. {
  56.      cprintf("Test pattern to fill screen.\n");
  57.      cprintf("Test pattern to fill screen.\n");
  58.      cprintf("Test pattern to fill screen.\n");
  59.      cprintf("Test pattern to fill screen.\n");
  60.      cprintf("Test pattern to fill screen.\n");
  61.      cprintf("Test pattern to fill screen.\n");
  62.      cprintf("Test pattern to fill screen.\n");
  63.      cprintf("Test pattern to fill screen.\n");
  64.  
  65.      cls();
  66. }  end of commented out code  for test routine */
  67.